import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;


 class OutputStreamDemo {
  public static void main(String[] args) throws IOException{
	 // byte[] b = new byte[]{97,119,100,123,122,97,98};
	  OutputStream out =  new FileOutputStream("D:\\workspace\\JavaProExample9\\src\\1.txt");
	  
	  InputStream in= new FileInputStream("D:\\workspace\\JavaProExample9\\src\\2.txt");

	  byte[] b = new byte[4];
	  int len =0;
	  while(len != -1){
		  len = in.read(b);
		  out.write(b,0,len);
		 
		  
	  }
	  in.close();
	  out.close();
  }
}
 
